package com.jboost.modules.app.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Objects;
import java.util.Optional;

@AllArgsConstructor
@Getter
public enum XmOrderBackEnum {
    A("1.待处理","13735892556"),
    B("2.已下单","6434253413761"),
    C("3.已验货未备货","141490057261"),
    D("4.备货完成","13735873377"),
    E("5.已出货未收余款","13735884690"),
    F("6.已完成","13735898470");
    String type;
    String msg;

    public static String getMsg(String type){
        Optional<XmOrderBackEnum> first = Arrays.stream(XmOrderBackEnum.values()).filter(e -> Objects.equals(e.getType(), type)).findFirst();

        if (first.isPresent()) {
            return first.get().getMsg();
        }
        return "";
    }
}
